<template>
  <j-modal :title="title" :width="width" :visible="visible" switchFullscreen @ok="handleOk"
    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" :cancelText="$t('取消')">
    <bis-game-repair-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bis-game-repair-form>
  </j-modal>
</template>

<script>

import BisGameRepairForm from './BisGameRepairForm'
export default {
  name: 'BisGameRepairModal',
  components: {
    BisGameRepairForm
  },
  data() {
    return {
      title: '',
      width: 800,
      visible: false,
      disableSubmit: false
    }
  },
  methods: {
    add() {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.add();
      })
    },
    edit(record, type) {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.edit(record, type);
      })
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleOk() {
      this.$refs.realForm.submitForm();
    },
    submitCallback() {
      this.$emit('ok');
      this.visible = false;
    },
    handleCancel() {
      this.close()
    }
  }
}
</script>